<template>
  <div>
    <button @click="sub">-</button>
    <span>{{ value }}</span>
    <button @click="add">+</button>
  </div>
</template>

<script>
export default {
  name: 'NumberBox',
  props: ['value'],
  methods: {
    add() {
      this.$emit('input', this.value+1)
    },
    sub() {
      this.$emit('input', this.value-1)
    },
  },
}
</script>

<style lang="less" scoped>
span {
  display: inline-block;
  margin: 0 5px;
}
</style>
